home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC]
/
NeXTSTEP 3.3 Dev Intel.iso
/
usr
/
lib
/
nib
/
Makefile.common
< prev
next >
Wrap
Makefile
|
1992-03-05
|
4KB
|
128 lines
#
# NOTE: Do NOT change this file -- InterfaceBuilder depends on it.
#
OFILE_DIR = obj
VPATH = $(OFILE_DIR)
SOURCEFILES = $(CLASSES) $(CLASSES:.m=.h) $(INTERFACES) $(APPICON) $(DOCICONS)\
$(MFILES) $(CFILES) $(HFILES) $(PSWFILES) $(PSWMFILES) $(OTHERSRCS) \
$(OTHER_SOURCEFILES) $(TIFFFILES) $(SNDFILES) \
IB.proj Makefile $(NAME).iconheader
IFLAGS = -c -s -m 755
SRCPROTECTION = 444
OFILES = $(PSWFILES:.psw=.o) $(PSWMFILES:.pswm=.o) $(CLASSES:.m=.o) \
$(MFILES:.m=.o) $(CFILES:.c=.o)
NIBLIBDIR = /usr/lib/nib
GARBAGE = $(PSWFILES:.psw=.c) $(PSWMFILES:.pswm=.m) \
$(OTHER_GARBAGE)
APPICONFLAGS = -sectcreate __ICON __header $(NAME).iconheader $(ICONSECTIONS)
.c.o:
$(CC) $(CFLAGS) -c $*.c -o $(OFILE_DIR)/$*.o
.m.o:
$(CC) $(CFLAGS) $(OBJCFLAGS) -c $*.m -o $(OFILE_DIR)/$*.o
.psw.c:
$(PSWRAP) $(PSWFLAGS) -a -h $*.h -o $*.c $*.psw
.psw.o:
$(PSWRAP) $(PSWFLAGS) -a -h $*.h -o $*.c $*.psw
$(CC) $(CFLAGS) -c $*.c -o $(OFILE_DIR)/$*.o
.pswm.m:
$(PSWRAP) $(PSWFLAGS) -a -h $*.h -o $*.m $*.pswm
.pswm.o:
$(PSWRAP) $(PSWFLAGS) -a -h $*.h -o $*.m $*.pswm
$(CC) $(CFLAGS) $(OBJCFLAGS) -c $*.m -o $(OFILE_DIR)/$*.o
PRODUCT_DEPENDS = $(OFILE_DIR) $(OFILES) $(OTHER_OFILES) $(INTERFACES) \
$(OTHER_PRODUCT_DEPENDS)
INSTALL_DEPENDS = $(DSTROOT)$(INSTALLDIR) all $(OTHER_INSTALL_DEPENDS)
#
#
all::
$(MAKE) $(NAME) "OFILE_DIR = obj" \
"CFLAGS = $(CFLAGS) -O -g -Wimplicit"
debug::
$(MAKE) $(NAME).debug "OFILE_DIR = debug_obj" \
"CFLAGS = $(CFLAGS) -g -DDEBUG -Wimplicit"
profile::
$(MAKE) $(NAME).profile "OFILE_DIR = profile_obj" \
"CFLAGS = $(CFLAGS) -O -pg -Wimplicit" \
"LIBS = -lNeXT_p -lsys_p" \
"OTHER_LIBS = $(OTHER_PROF_LIBS)"
clean::
-/bin/rm -rf $(NAME) $(NAME).debug $(NAME).profile \
obj debug_obj profile_obj $(GARBAGE) *.o gmon.out
diff:: SRCROOT
@for f in $(SOURCEFILES); \
do (echo $$f; \
csh -f -c "diff -c $(SRCROOT)/$$f $$f; exit 0") \
done
Makefile.dependencies depend: $(SOURCEFILES)
-/bin/rm -f Makefile.dependencies
$(CC) -M $(CFLAGS) $(CLASSES) $(MFILES) $(CFILES) | \
awk '{ if ($$1 != prev) { if (rec != "") print rec; \
rec = $$0; prev = $$1; } \
else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
else rec = rec " " $$2 } } \
END { print rec }' > Makefile.dependencies
installsrc:: SRCROOT
-/bin/rm -rf $(SRCROOT)
mkdirs $(SRCROOT)
chmod 755 $(SRCROOT)
tar cf - $(SOURCEFILES) | (cd $(SRCROOT); tar xf -)
chmod $(SRCPROTECTION) $(SRCROOT)/*
install:: $(INSTALL_DEPENDS)
install $(IFLAGS) $(NAME) $(DSTROOT)$(INSTALLDIR)
help::
@echo ' all (the default)'
@echo ' debug'
@echo ' profile'
@echo ' clean'
@echo ' installsrc SRCROOT=somepath'
@echo ' install [DSTROOT=somepath]'
@echo ' depend'
@echo ' diff SRCROOT=somepath'
#
#
$(OFILE_DIR) $(DSTROOT)$(INSTALLDIR):
mkdirs $@
SRCROOT:
@if [ -n "${$@}" ]; then exit 0; \
else echo Must define $@; exit 1; fi
$(NAME) $(NAME).debug $(NAME).profile: $(PRODUCT_DEPENDS)
@ldflags="$(LDFLAGS) $(APPICONFLAGS)"; \
for i in $(INTERFACES) nonibfiles ; do \
if [ $$i = nonibfiles ] ; then continue; fi; \
ldflags="$$ldflags -sectcreate __NIB $$i $$i"; \
done; \
for i in $(TIFFFILES) notifffiles ; do \
if [ $$i = notifffiles ] ; then continue; fi; \
ldflags="$$ldflags -sectcreate __TIFF $$i $$i"; \
done; \
for i in $(SNDFILES) nosndfiles ; do \
if [ $$i = nosndfiles ] ; then continue; fi; \
ldflags="$$ldflags -sectcreate __SND $$i $$i"; \
done; \
for i in $(LIBINTERFACES) nonibfiles ; do \
if [ $$i = nonibfiles ] ; then continue; fi; \
ldflags="$$ldflags -sectcreate __NIB $$i $(NIBLIBDIR)/$$i"; \
done; \
echo $(CC) $(CFLAGS) $$ldflags -o $@ $(OFILES) $(OTHER_OFILES) \
$(OTHER_LIBS) $(LIBS) ; \
$(CC) $(CFLAGS) $$ldflags -o $@ $(OFILES) $(OTHER_OFILES) \
$(OTHER_LIBS) $(LIBS)